package com.xcfw.dorm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Duty {
    private Integer id;

    private String building;

    private Byte floor;

    private String buildingDormitory;

    private String beginTime;

    private String endTime;

    private String uuid;

    private Date updateTime;

    private Date createTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Duty duty = (Duty) o;
        return Objects.equals(building, duty.building) &&
                Objects.equals(floor, duty.floor) &&
                Objects.equals(buildingDormitory, duty.buildingDormitory) &&
                Objects.equals(beginTime, duty.beginTime) &&
                Objects.equals(endTime, duty.endTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(super.hashCode(), building, floor, buildingDormitory, beginTime, endTime);
    }
}